#include <iostream>
#include <string>
#include <windows.h>

using namespace std;

int main()
{
	SetConsoleCP(1251);
	setlocale(0, "ru`");
	string line , word =" ";
	getline(cin, line);
	line += ' ';
	int wordsCount = 0;
	bool hasLatin = false;
	for (char ch : line)
	{
		if (ch == ' ')
		{
			wordsCount++;
			cout << " Букв " << " " << hasLatin << endl;
			word.clear();
			hasLatin = false;

		}
		else
		{
			word += ch;
			if (ch >= 'a' && ch <= 'z');
			if (ch >= 'A' && ch <= 'Z');
			hasLatin = true;

		}
	}
	cout <<" Слов" << wordsCount;
}

